﻿<Window x:Class="WPFDemo.WPFDemoWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:demoControls="clr-namespace:WPFDemo"
    Title="WPF Carousel Control Demo" 
        Height="750" Width="522"
        Loaded="Window_Loaded" >
    <Window.Resources>
        <ResourceDictionary>

        <LinearGradientBrush x:Key="GroupBackground" EndPoint="0.5,1" StartPoint="0.5,0" SpreadMethod="Pad" MappingMode="RelativeToBoundingBox">
            <GradientStop Color="#FFFFFFFF" Offset="0"/>
            <GradientStop Color="#FFFFFFFF" Offset="1"/>
            <GradientStop Color="#FF96CE99" Offset="0.515"/>
            <GradientStop Color="#FFD7E7D5" Offset="0.445"/>
        </LinearGradientBrush>
            
        </ResourceDictionary>
    </Window.Resources>
   

    <Grid Name="MainGrid" >
        <Grid Name="InnerGrid" >
            <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                <GradientStop Color="#FF88BB85" Offset="0.236"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions >
            <RowDefinition Height="50" />
            <RowDefinition Height="500" />
            <RowDefinition Height="160" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="500" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Row="0" Grid.ColumnSpan="3" Margin="0,5,0,0" Foreground="Black"  Name="TitleTextBlock" HorizontalAlignment="Center" TextAlignment="Center" FontSize="24"  VerticalAlignment="Top" Text="WPF Carousel Control Demo" RenderTransformOrigin="0.5,0.5" >
        	<TextBlock.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1" ScaleY="1"/>
        			<SkewTransform AngleX="0" AngleY="0"/>
        			<RotateTransform Angle="0"/>
        			<TranslateTransform X="0" Y="0"/>
        		</TransformGroup>
        	</TextBlock.RenderTransform>
        </TextBlock>

        <Grid Panel.ZIndex="10" Grid.Row="1" Grid.Column="1" x:Name="CarouselExample" RenderTransformOrigin="0.5,0.5" Background="{DynamicResource GroupBackground}" >
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Grid.RenderTransform>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition />
                    <RowDefinition Height="50" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                    <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Margin="10" TextWrapping="Wrap" VerticalAlignment="Center" >
                        <Run Text="     The Carousel Control can be used for selecting items." />
                        <LineBreak />
                        <Run Text="     (Click on a sphere below)" />
                    </TextBlock>
                   
                    <demoControls:CarouselControl Grid.Row="1" Grid.ColumnSpan="2" x:Name="ExampleCarouselControl" Width="600" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" OnElementSelected="ExampleCarouselControl_OnElementSelected" >
                  
                        <demoControls:SphereControl x:Name="BlackSphere" Width="60" Height="60" InnerColorBrush="DimGray" OuterColorBrush="#FF000000" Canvas.Left="268.82"/>
                        <demoControls:SphereControl x:Name="RedSphere" Width="60" Height="60" InnerColorBrush="Red" OuterColorBrush="DarkRed" Canvas.Left="268.82"/>
                        <demoControls:SphereControl x:Name="GreenSphere" Width="60" Height="60" InnerColorBrush="LimeGreen" OuterColorBrush="DarkGreen" Canvas.Left="268.82"/>
                        <demoControls:SphereControl x:Name="BlueSphere" Width="60" Height="60" InnerColorBrush="Blue" OuterColorBrush="DarkBlue" Canvas.Left="268.82"/>
                        <demoControls:SphereControl x:Name="YellowSphere" Width="60" Height="60" InnerColorBrush="Yellow" OuterColorBrush="Orange" Canvas.Left="268.82"/>
                        <demoControls:SphereControl x:Name="PurpleSphere" Width="60" Height="60" InnerColorBrush="Magenta" OuterColorBrush="Purple" Canvas.Left="268.82"/>
                        <demoControls:SphereControl x:Name="OrangeSphere" Width="60" Height="60" InnerColorBrush="Orange" OuterColorBrush="Red" Canvas.Left="268.82"/>
                    
                    </demoControls:CarouselControl>

                    <Grid Grid.Row="2" Grid.ColumnSpan="2" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="110" />
                            <ColumnDefinition Width="60" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <TextBlock TextAlignment="Right" VerticalAlignment="Top" Margin="5" >Selected Sphere:</TextBlock>
                        <Ellipse Grid.Column="1" Name="CurrentlySelectedEllipse" Width="40" Height="40" />
                        <TextBlock Grid.Column="2" Name="CurrentlySelectedNameShadowTextBlock" TextAlignment="Left" FontSize="20" Margin="7,13,3,11" Foreground="Black" Opacity="0.5" FontWeight="Bold" ></TextBlock>
                        <TextBlock Grid.Column="2" Name="CurrentlySelectedNameTextBlock" TextAlignment="Left" FontSize="20" VerticalAlignment="Center" Margin="5" FontWeight="Bold" ></TextBlock>

                    </Grid>

                <Border Grid.ColumnSpan="2" Grid.RowSpan="3" BorderThickness="3" BorderBrush="{StaticResource StandardBorderBrush}"  />

                </Grid>
        </Grid>
        <Grid Panel.ZIndex="9" Grid.Row="2" Grid.Column="1" RenderTransformOrigin="0.5,0.5" x:Name="CarouselExampleSettings" Background="{DynamicResource GroupBackground}" >
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Grid.RenderTransform>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" TextAlignment="Right" VerticalAlignment="Center" Margin="5" >Speed:</TextBlock>
                <Slider Grid.Row="0" Grid.Column="1" Margin="5" VerticalAlignment="Center" Name="CarouselSpeedSlider" ValueChanged="CarouselSpeedSlider_ValueChanged" Minimum="1" Maximum="1000" Value="200" />

                <TextBlock Grid.Row="1" TextAlignment="Right" VerticalAlignment="Center" Margin="5" >Lookdown Offset:</TextBlock>
                <Slider Grid.Row="1" Grid.Column="1" Margin="5" VerticalAlignment="Center" Name="LookdownOffsetSlider" ValueChanged="LookdownOffsetSlider_ValueChanged" Minimum="-100" Maximum="100" Value="20" />

                <TextBlock Grid.Row="2" TextAlignment="Right" VerticalAlignment="Center" Margin="5" >Fade:</TextBlock>
                <Slider Grid.Row="2" Grid.Column="1" Margin="5" VerticalAlignment="Center" Name="FadeSlider" ValueChanged="CarouselFadeSlider_ValueChanged" Minimum="0" Maximum="1" Value=".5" />

                <TextBlock Grid.Row="3" TextAlignment="Right" VerticalAlignment="Center" Margin="5" >Scale:</TextBlock>
                <Slider Grid.Row="3" Grid.Column="1" Margin="5" VerticalAlignment="Center" Name="ScaleSlider" ValueChanged="CarouselScaleSlider_ValueChanged" Minimum="0" Maximum="1" Value=".5" />
                
                <RadioButton Name="HorizontalSelectionRadio" Grid.Row="4" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Horizontal" GroupName="Orientation" Checked="HorizontalOrientationRadioButton_Checked" IsChecked="True" />
                <RadioButton Name="VerticalSelectionRadio" Grid.Row="4" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Vertical" GroupName="Orientation" Checked="VerticalOrientationRadioButton_Checked" />

                <Border Grid.ColumnSpan="2" Grid.RowSpan="5" BorderThickness="3" BorderBrush="{StaticResource StandardBorderBrush}"  />


               
                </Grid>
        </Grid>



           
            <TextBlock Height="Auto" Margin="11,34,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="18" FontStyle="Italic" x:Name="ScalingModalTitleShadow" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#AA000000" Text="Carousel Control:"/></TextBlock>
           
           
            <TextBlock Height="Auto" Margin="10,33,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="18" FontStyle="Italic" x:Name="ScalingModalTitle" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5" Foreground="#FF000000">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#FF3EDD79" Text="Carousel Control:"/></TextBlock>
           
          
            <TextBlock Height="Auto" Margin="11,501,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="16" FontStyle="Italic" x:Name="ScalingModalSettingsShadow" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5" IsHitTestVisible="False" >
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#AA000000" Text="Settings:"/></TextBlock>
           

             <TextBlock Height="Auto" Margin="10,500,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="16" FontStyle="Italic" x:Name="ScalingModalSettings" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5" Foreground="#FF000000" IsHitTestVisible="False" >
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#FF3EDD79" Text="Settings:"/></TextBlock>
      


        </Grid>
    </Grid>
</Window>
